package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementQosStrategyActionMapper;
import com.ruoyi.net.domain.ElementQosStrategyAction;
import com.ruoyi.net.service.IElementQosStrategyActionService;

/**
 * 网元-QOS配置-流策略Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementQosStrategyActionServiceImpl implements IElementQosStrategyActionService 
{
    @Autowired
    private ElementQosStrategyActionMapper elementQosStrategyActionMapper;

    /**
     * 查询网元-QOS配置-流策略
     * 
     * @param id 网元-QOS配置-流策略主键
     * @return 网元-QOS配置-流策略
     */
    @Override
    public ElementQosStrategyAction selectElementQosStrategyActionById(String id)
    {
        return elementQosStrategyActionMapper.selectElementQosStrategyActionById(id);
    }

    /**
     * 查询网元-QOS配置-流策略列表
     * 
     * @param elementQosStrategyAction 网元-QOS配置-流策略
     * @return 网元-QOS配置-流策略
     */
    @Override
    public List<ElementQosStrategyAction> selectElementQosStrategyActionList(ElementQosStrategyAction elementQosStrategyAction)
    {
        return elementQosStrategyActionMapper.selectElementQosStrategyActionList(elementQosStrategyAction);
    }

    /**
     * 新增网元-QOS配置-流策略
     * 
     * @param elementQosStrategyAction 网元-QOS配置-流策略
     * @return 结果
     */
    @Override
    public int insertElementQosStrategyAction(ElementQosStrategyAction elementQosStrategyAction)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementQosStrategyAction.getId())) {
            elementQosStrategyAction.setId(uuid);
        }
        elementQosStrategyAction.setCreateBy(SecurityUtils.getUsername());
        elementQosStrategyAction.setCreateTime(DateUtils.getNowDate());
        elementQosStrategyAction.setUpdateBy(SecurityUtils.getUsername());
        elementQosStrategyAction.setUpdateTime(DateUtils.getNowDate());
        return elementQosStrategyActionMapper.insertElementQosStrategyAction(elementQosStrategyAction);
    }

    /**
     * 修改网元-QOS配置-流策略
     * 
     * @param elementQosStrategyAction 网元-QOS配置-流策略
     * @return 结果
     */
    @Override
    public int updateElementQosStrategyAction(ElementQosStrategyAction elementQosStrategyAction)
    {
        elementQosStrategyAction.setUpdateBy(SecurityUtils.getUsername());
        elementQosStrategyAction.setUpdateTime(DateUtils.getNowDate());
        return elementQosStrategyActionMapper.updateElementQosStrategyAction(elementQosStrategyAction);
    }

    /**
     * 批量删除网元-QOS配置-流策略
     * 
     * @param ids 需要删除的网元-QOS配置-流策略主键
     * @return 结果
     */
    @Override
    public int deleteElementQosStrategyActionByIds(String[] ids)
    {
        return elementQosStrategyActionMapper.deleteElementQosStrategyActionByIds(ids);
    }

    /**
     * 删除网元-QOS配置-流策略信息
     * 
     * @param id 网元-QOS配置-流策略主键
     * @return 结果
     */
    @Override
    public int deleteElementQosStrategyActionById(String id)
    {
        return elementQosStrategyActionMapper.deleteElementQosStrategyActionById(id);
    }
}
